Remove the first occurrence of elementΒΆ
A.remove(N)
Remove the first occurrence of a specified element from an array.
from array import *
AI = array('i', [1, 3, 5, 3, 7, 1, 9, 3])
print("Original array: " + str(AI))
# Original array: array('i', [1, 3, 5, 3, 7, 1, 9, 3])
print("Remove the first occurrence of 3 from the said array:")
AI.remove(3)
print("New array: " + str(AI))
# New array: array('i', [1, 5, 3, 7, 1, 9, 3])
See also: https://www.w3resource.com/python-exercises/array/python-array-exercise-12.php